import React from "react";
import { View, Text } from "react-native";
import styles from "./index.style";
import { useTheme } from "@/contexts/ThemeContext";

interface SettingsSectionProps {
  title?: string;
  children: React.ReactNode;
}

const SettingsSection: React.FC<SettingsSectionProps> = ({
  title,
  children,
}) => {
  const { colors } = useTheme();

  return (
    <View style={styles.container}>
      {title && (
        <Text style={[styles.title, { color: colors.primary }]}>{title}</Text>
      )}
      <View style={[styles.content, { backgroundColor: colors.background }]}>
        {children}
      </View>
    </View>
  );
};

export default SettingsSection;
